<template>
  <view class="my">
    <MyHeader ref="headerMethods"></MyHeader>
    <List></List>
  </view>
</template>

<script>
import MyHeader from "./components/MyHeader.vue";
import List from "./components/List.vue";
export default {
  components: {
    MyHeader,
    List,
  },
  data() {
    return {};
  },
  onShow() {
    let userInfo = uni.getStorageSync("userInfo");
    if (!userInfo) {
      uni.navigateTo({
        url: "/pages/login/login",
      });
    } else {
      setTimeout(() => {
		this.isLogin();
        this.loadUserInfo();
      }, 100);
    }
  },
  methods: {
    loadUserInfo() {
      this.$refs.headerMethods.loadUserInfo();
    },
	isLogin() {
	  this.$refs.headerMethods.isLogin();
	},
  },
};
</script>

<style scoped lang="scss" >
.my {
  width: 100%;
  height: 100vh;
  background: #edf0f5;
}
</style>
